package com.yisu.expressway.onedollar.model;

import android.text.TextUtils;

import java.io.Serializable;

/**
 * Created by Kaven on 2016/12/20.
 */

public class UserAddressItem extends SelectedBean  implements Serializable{
    private static final long serialVersionUID = -396949947205995454L;
    public String address;//收货人详细收获地址 string
    public String area;//收货人地区 string
    public String city;//收货人城市 string
    public String consigneeName;//收货人姓名 string
    public String consigneePhone;//收货人手机 string
    public String createTime;//创建时间 string
    public long isDefault;//是否默认地址 number
    public String province;//收货人省份 string
    public long recordId;//主键 number
    public String userAccount;//用户账号 number

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        if (!TextUtils.isEmpty(province)){
            builder.append(province);
        }

        if (!TextUtils.isEmpty(city)){
            builder.append(city);
        }

        if (!TextUtils.isEmpty(area)){
            builder.append(area);
        }

        if (!TextUtils.isEmpty(address)){
            builder.append(address);
        }
        return builder.toString();
    }

    public String toAreaString() {
        StringBuilder builder = new StringBuilder();
        if (!TextUtils.isEmpty(province)){
            builder.append(province);
        }

        if (!TextUtils.isEmpty(city)){
            builder.append(city);
        }

        if (!TextUtils.isEmpty(area)){
            builder.append(area);
        }

        return builder.toString();
    }
}
